package com.lagou.model;

import java.io.Serializable;
import java.util.Objects;

/**
 * 考题类
 */
public class Quiz implements Serializable {

    private static final long serialVersionUID = 4973202544092814420L;

    /**
     * 题目内容
     */
    private String content;

    /**
     * 答案
     */
    private String answer;

    public Quiz() {
    }

    public Quiz(String content, String answer) {
        this.content = content;
        this.answer = answer;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    @Override
    public String toString() {
        return "{" + content + "，答案：" + answer + '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Quiz quiz = (Quiz) o;
        return getContent().equals(quiz.getContent()) &&
                getAnswer().equals(quiz.getAnswer());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getContent(), getAnswer());
    }
}
